import formBuilder from "@/comps/form/formBuilder";
import api from "./api";
import apiItemBase from "@/pages/v1/wms/ItemBase/js/api";
import apiUnit from "@/pages/v1/wms/Unit/js/api";

export default {
    main:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)

        fb.addSearch("itemBaseId","物资",12)
            .setApi(apiItemBase.urlChoice).setApiSearchKeys(["name__like"])

        fb.addSelect("unitId","单位",3).setApi(apiUnit.urlChoice)

        fb.addText("unitBase","基本单位基数",3).setTypeNumber()

        fb.addText("unitExchange","单位转换量",3).setTypeNumber()

        fb.addText("version").setSpan(3).setLabel("版本").setTypeNumber()

        fb.addSwitch("isOn","启用",3).setSpan(3)

        return fb
    },
    other:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100).setLabelPosition("right")

        return fb
    }
}